﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using PrinterBudi.Persistence;

namespace PrinterBudi.Desktop
{

    public sealed class CALogin : CodeActivity
    {
        // Define an activity input argument of type string
        public InArgument<string> InUser { get; set; }
        public InArgument<string> InPass { get; set; }
        public OutArgument<bool> OutStatus { get; set; }

        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void Execute(CodeActivityContext context)
        {
            // Obtain the runtime value of the Text input argument
            string user = context.GetValue(this.InUser);
            string pass = context.GetValue(this.InPass);
            bool status = LoginController.IsLoginEmployeeSuccess(user, pass);
            OutStatus.Set(context, status);
        }
    }

}
